home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
335_04
/
devnote.dos
< prev
next >
Wrap
Text File
|
1990-12-02
|
5KB
|
135 lines
1. Disclaimer
This software is in the public domain.
Any prior copyright claims are relinquished.
This software is distributed with no warranty whatever.
The author takes no responsibility for the consequences
of its use.
2. Size
You can compile the assemblers small model (64k + 64k).
Getting them any smaller would be a real trick.
If you run small model, the STRALLOCSZ and SYELPB macro
defines in frapsub.c should be reduced to get a finer
granularity in packing the symbol table into the available
memory.
3. Compilation
The C source files that comprise a cross assembler are
in 3 categories.
Common code (doesn't need recompiling between different
"flavors")
frasmain.c
fraosub.c
frapsub.c
"Flavor" specific files (generated by Yacc, compiled
for every "flavor"))
as*.c
as*.h
Common code that depends on the fraytok.h file (compiled
for every "flavor")
fryylex.c
4. Fraytok.h
The yacc program defines some data structures and assigns values
to various #define Macros used in the lexical analyzer.
The lexical analyzer (fryylex.c) file refers to these in the
fraytok.h include file. The {assembler name}.h file generated
by yacc (or renamed in the makefile) for the different .y files
will be different. If you compile manually, insure that the correct
{assembler name}.h file is copied to fraytok.h.
5. Configuration Macros
DOSTEMP
If neither the current directory or /usr/tmp is an acceptable
directory for the temporary intermediate data file, change the
initialization in frasmain.c.
NOGETOPT
If you use the NOGETOPT to use the provided function, remember
to change the MAINDEPENDS makefile macro.
NOSTRING, USEINDEX
The version 7 system I used to test these for version 1 got sold
for scrap. Should still work ;-)
6. Dos
You'll have to rename the makefile.dos to makefile.
If you don't have a MS-DOS (or whatever) Yacc equivalent, but do have
access to a another computer with Yacc, you can run that step there
and take the resulting .c and .h files to the (whatever) system.
(I have not inquired at AT&T as to the copyright status of the
resulting code, although it is rumored that the output of Yacc
is public domain. Do this at your own risk. [The Yacc program
itself is definitly NOT public domain]).
The combination used (Turbo C and Bison) will report a half
a dozen (varies) shift-reduce conflicts from Bison, and 3 (usually)
warnings from the C compiler for the parser. No big deal.
The Bison (the Free Software Foundation's Yacc clone) I used
was disk 285 from the C Users Group. The version dated
January 1989. This is modified from the original, to
adapt it to MS-DOS compilers, conventions, and libraries.
(The following paragraph was copied out of this release)
The C Users' Group (CUG) collects, maintains and distributes
public domain C source code, publishes a magazine, The C Users' Journal
and serves as a resource for C users. Several vendors have named
CUG as the official users group for their implementation of C.
For membership and subscription information contact
The C Users' Group
2601 Iowa
Lawrence, KS 66047
(913) 841-1631
7. Porting to non-ascii machines
The fryylex.c file contains a translate table, chartrantab,
which classifies the input character set for the scanner's
state machine. The reference to this table masks off the
input character with 0x7f limiting the table to 128 elements.
So if you want a source file in EBCDIC or to have umlauts in
your variable names, a new table, and a new mask are called for.
Debug in the lexical analyzer is turned on with a nonzero
value in the DEBUG macro.
Host machines that don't use two-complement negative numbers
will have to compensate in the fraosub.c outeval()
switch statement for cases IFC_EMU8, IFC_EMS7, IFC_EM16,
IFC_EMBR16.
8. History
These used to be called the Framework cross assemblers, but
there's someone using the name for a database package or
something like that. Why Frankenstein? Well, if you don't
like the way it acts, chop off it's head and sew a new one on.
(It was around Halloween).
The .y files are generated from a more general machine
description by an automated script. But this isn't
portable enough and is too disgusting to distribute.
Mark Zenier
6340 Atlas Pl. SW
Seattle, WA 98136